<?php if (!defined("_ECRIRE_INC_VERSION")) return;
/**
 * Aloha Cart
 *
 * @author     Aleksey Yaroshchuk (aleksey.yaroshchuk@gmail.com)
 * @license    GNU/GPL
 * @package    plugins
 * @subpackage alohacart
 * @copyright  (c) Aleksey Yaroshchuk 2011-2012
 * @link       http://www.spip-contrib.net/AlohaCart
 */

include_spip('classes/alohacart');
 
/**
 *  Dymanic Tag wich outputs quantity of products in the Cart
 *  Format: #ALOHACART_CART_QUANTITY
 */
function balise_ALOHACART_CART_QUANTITY($p) {	
	return calculer_balise_dynamique($p,'ALOHACART_CART_QUANTITY', array());
}

function balise_ALOHACART_CART_QUANTITY_stat($args, $filtres) {    
	return $args;
}

function balise_ALOHACART_CART_QUANTITY_dyn() {
    $cart = new AlohaCart();
    $quantity = $cart->CountProducts();
    
    return array('balise/alohacart_cart_quantity', 0, 
		array(
            'quantity'=> $quantity
		));
}

?>